<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php"); ?>
<?php include_once("../controller/detail-edit.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php include_once('../../../modules/head.php'); ?>
    <!--kindeditor编辑器-->
    <?php include_once('modules/mod-nkeditor.php'); ?>
</head>



<body>

<div id="topbar">
    <?php include '../../../modules/topbar.php'; ?>
</div>



<div id="container">

<!--Container端點01-->

<div id="maincontent"   class="detail">

<!--maincontent端點01-->



<div id="sidebar">
    <?php include '../../../modules/sidebar.php'; ?>
</div>





<div id="content">

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">

        <legend><h1>编辑横幅 : <? echo $data['name'] ?></h1></legend>

    </fieldset>





<div class="detail-box banner-detail-box">



<div class="detail-box layui-form <? echo $system_part ?>">

<div class="detail-boxes">

<ul class="detail-boxing">

<form id="detail_detail_form" method="post" class="layui-form-pane"  onsubmit="return checkRequired(ai_name);"  action="detail-edit-function.php?sys_part=<? echo $system_part ?>"

      enctype="multipart/form-data" name="uploadfile">



       <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">

        <legend>基本信息</legend>

    </fieldset>

    <blockquote class="layui-elem-quote">基本信息多数是对外使用的资料，请细心填写。</blockquote>

    <br/>



<input name="nid" type="hidden" value="<?php echo $data['nid'] ?>"/>



<li class="layui-form-item name">
    <label class="layui-form-label">名称：</label>
    <div class="layui-input-block">
        <input type="text" class="layui-input"  name="ai_name" size="20" value="<? echo $data['name'] ?>">
    </div>
    <em class="explain">(<u style="color:red">*必填项目</u>, 填写标题)</em>
 </li>



<li class="layui-form-item model">
    <label class="layui-form-label">型号：</label>
    <div class="layui-input-block">
         <input type="text" class="layui-input"  name="ai_model" size="20" value="<? echo $data['model'] ?>">
    </div>
</li>



<li class="layui-form-item term">

	<label class="layui-form-label">分类：</label>

	<div class="layui-input-block">

		<select name="ai_banner_term">
            <option value="<?php echo $data['banner_term'] ?>">当前所属分类: | - <?php echo $now_banner_term['name'] ?></option>
            <?php for ($i = 0; $i < count($term); $i++) {?>
            <option value="<?php echo $term[$i]['nid'] ?>"> | - <?php echo $term[$i]['name'] ?></option>
            <?php;} ?>
        </select>

	</div>

<em class="explain">(选择对应的分类)</em></li>


<li class="layui-form-item introduce">
    <label class="layui-form-label">简介：</label>
    <div class="layui-input-block">
    <textarea class="layui-textarea" name="ai_introduce" cols="20"  style="width:800px;"><? echo $data['introduce'] ?></textarea>
	</div>
</li>





<?php include_once("modules/mod-images-upload.php"); ?>


    <li class="layui-form-item video" >
        <label class="layui-form-label" >视频上传：</label>
        <div class="layui-input-block">
            <input type="file" id="upload_video" />
            <button type="button" class="layui-btn" id="UploadAction" >上传视频</button>
            <div class="layui-progress" style="margin:10px 0;" lay-filter="progress" lay-showPercent="true" id="prouploadfile">
                <div class="layui-progress-bar" lay-percent="0%"></div>
            </div>

            <video id="video" src="/uploadfiles/<? echo $theme_folder ?>/<?php echo  $data['video_path']; ?>" controls="controls" width="100" height="100"> 您的浏览器不支持 video 标签。 </video>


        </div>

        <input type="hidden" name="ai_video_path" class="video_path" value="<?php echo  $data['video_path']; ?>" />

        <input type="hidden" id="duration" name="ai_video_time"  value="<?php echo  $data['video_time']; ?>" />
        <input type="hidden" id="video_img" name="ai_video_img"  value="<?php echo  $data['video_img']; ?>" />

        <em class="explain">视频上传中，请勿刷新或者提交</em> </li>






<li class="layui-form-item detail">
    <label class="layui-form-label">资料详情：</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea" name="ai_detail" style="width:800px;height:400px;visibility:hidden;">
                <? echo $data['detail'] ?>
            </textarea>
        </div>
</li>





    <!--这个用来做有限次数点击-->
    <li class="layui-form-item stock"><label class="layui-form-label">库存：</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="ai_stock" size="20"
                   value="<?echo $data['stock']?>"
                   onkeyup="checknum(ai_stock);" onfocus="checkdefault(ai_stock)" onblur="checkempty(ai_stock)">
        </div>
    </li>




<li class="layui-form-item listorder">
    <label class="layui-form-label">列表排序：</label>
    <div class="layui-input-block">
        <input
               type="text" class="layui-input" name="ai_listorder"
               size="20"   value="<?echo $data['listorder']?>"
               onkeydown ="onlyNum()"
               onfocus   ="checkdefault(ai_listorder)"
               onblur    ="checkempty(ai_listorder)">
    </div>
    <em class="explain">(填写本文在所属前台列表下的列表排序，数字越大，排序越靠前)</em>
</li>


    <li class="layui-form-item recommend">
        <label class="layui-form-label">推荐状态：</label>
        <div class="layui-input-block">
            <input name='ai_recommend' type='radio' value='1' title="标记推荐" <? if ($data['recommend'] == '1') {
                echo "checked='checked'";
            } ?>/>
            <input name='ai_recommend' type='radio' value='0' title="取消推荐" <? if ($data['recommend'] == '0') {
                echo "checked='checked'";
            } ?>/>
        </div>
    </li>










<li class="layui-form-item publish">

	<label class="layui-form-label">发布状态：</label>
    <div class="layui-input-block">
         <input name='ai_publish' type='radio' value='1'  title="立即发布" <?if($data['publish'] == '1'){echo "checked='checked'";}?>/>
         <input name='ai_publish' type='radio' value='0'  title="暂未发布" <?if($data['publish'] == '0'){echo "checked='checked'";}?>/>
    </div>
    <em class="explain">(选择立即发布，以上信息才能在前台显示；选择暂未发布，只对以上信息进行保存，不在前台显示)</em>
</li>





    <li class="layui-form-item clickrate"><label class="layui-form-label">点击次数：</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input"  name="ai_clickrate" size="20"
                   value="<? echo $data['clickrate'] ?>" onkeydown="onlyNum();"
                   onfocus="checkdefault(detail_clickrate)" onblur="checkempty(detail_clickrate)">
        </div>
    </li>



<li class="layui-form-item link">
    <label class="layui-form-label">链接地址：</label>
    <div class="layui-input-block">
        <input type="text" class="layui-input"  name="ai_link" size="20" value="<? echo $data['link'] ?>">
    </div>

</li>




    <li class="layui-form-item target" style="display:">
        <label class="layui-form-label">新开窗口：</label>
        <div class='radio-box'>
            <input name='ai_target' type='radio' value='0' title="原窗口打开"   <?if($data['target'] == '0'){echo "checked='checked'";}?> />
            <input name='ai_target' type='radio' value='1' title="新窗口打开"   <?if($data['target'] == '1'){echo "checked='checked'";}?> />
        </div>
    </li>



<li class="layui-form-item onsaletime">
    <label class="layui-form-label">上架时间：</label>
    <div class="layui-input-block">
        <input type="text" class="layui-input"  name="ai_onsaletime"
               size="20" value="<? echo $data['onsaletime'] ?>"
               onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon">
    </div>
</li>



    <li class="layui-form-item offshelves">
        <label class="layui-form-label">下架时间：</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="ai_offshelves"
                   size="20" value="<? echo $data['offshelves'] ?>"
                   onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                   class="laydate-icon">
        </div>
    </li>




    <li class="layui-form-item modifytime">
        <label class="layui-form-label">修改时间：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input"  name="ai_modifytime" size="20"
                       value="<? echo $data['modifytime'] ?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                       class="laydate-icon">
            </div>
    </li>





<input name="sys_part"  type="hidden" value="<? echo $_REQUEST['sys_part'] ?>"/>
<input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
<input name="sortby"    type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>
<input name="term_nid"  type="hidden" value="<? echo $_REQUEST['term_nid'] ?>"/>



<div class="function">
    <input class="layui-btn" type="submit" value="确认"/>
    <input class="layui-btn" type="button" value="取消"/>
</div>

</form>

</ul>

</div>

</div>



<!--content端點01-->

</div>

<!--maincontent端點01-->

<br class="clearfloat"/>

</div>

<!--container端點01-->

</div>

    <script>
        var filePath_ = "/uploadfiles/" + "<?php echo $theme_folder?>" + "/";
        var videoUploadSwitch_ = false;
        var Browser = new Object();

        Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument != 'undefined');
        Browser.isIE = window.ActiveXObject ? true : false;
        Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != - 1);
        Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != - 1);
        Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != - 1);

    </script>

    <script charset="utf-8" src="modules/upload_video.js"></script>

<?php include  ROOT_PATH_."/controller/modules/footer.php"; ?>



</body>

</html>

